<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../comm/swiper.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/tabBar.css">
    <link rel="stylesheet" type="text/css" href="../comm/shop_comm.css" />
    <link rel="stylesheet" type="text/css" href="../comm/icon.css" />
    <link rel="stylesheet" type="text/css" href="./css/submit.css">
    <title>推荐</title>
</head>

<body>
    <div id="app" >
        <div class="header">
            <div class="header_left" @click="api.closeWin()">
                <img src="../../../image/backtrack.png" alt="">
            </div>
            <div class="header_center" >
                品牌合作
            </div>
            <div class="header_right"></div>
        </div>
        <div class="con_" v-cloak>
          <div class='sub_box'>
              <div class='sub_box_head'>
                <div class='sub_box_head_box'>
                  填写信息
                </div>
              </div>
              <div class='sub_box_con'>
                <div class='sub_box_con_list'>
                  <div class='sub_box_con_list_head'>
                    姓名
                  </div>
                  <div class='sub_box_con_list_box'>
                    <input type="text" placeholder='请填写联系人' maxlength='10'  v-model="setname">
                  </div>
                </div>

                <div class='sub_box_con_list'>
                  <div class='sub_box_con_list_head'>
                    联系方式
                  </div>
                  <div class='sub_box_con_list_box'>
                    <input type="number" oninput="if(value.length>20)value=value.slice(0,20)" placeholder='请填写联系方式' maxlength='30'  v-model="setphone">
                  </div>
                </div>

                <div class='sub_box_con_list'>
                  <div class='sub_box_con_list_head'>
                    说明
                  </div>
                  <div class='sub_box_con_list_box'>
                    <textarea v-model="setmessage" placeholder='填写合作说明' maxlength='500'></textarea>
                  </div>
                </div>

              </div>
            </div>
            <div class='bottom_btn'>
              <div class='btn' @click='send'>
                提交
              </div>
            </div>
        </div>
    </div>
</body>
<script src="../../sea.js" data-main="../../main"></script>
<script type="text/javascript" src="../../vue.js"></script>
<script type="text/javascript">
    apiready = function() {
        seajs.use(["../../api", "../../jquery", "../../app", "../../service", ], function($api, $, app, service) {
            var vm = {
                el: "#app",
                data: {
                    setname:"",
                    setphone:"",
                    setmessage:""
                },
                mounted: function() {
                  // this.getUserShopInfo()
                },
                methods: {
                  send:function(){
                    if(this.setphone.length<8){
                      api.toast({
                          msg: '请填写联系方式',
                          duration: 2000,
                          location: 'bottom'
                      });
                      return
                    }
                    app.ajax(service.doApply, {
                        data: {
                            values: {
                                username: this.setname,
                                mobile: this.setphone,
                                explain:this.setmessage,
                                mask:"none"
                            }
                        }
                    }, function(res) {
                        if (res.code == 0) {
                            api.toast({
                                msg: '提交成功，我们会尽快与您联系',
                                duration: 2000,
                                location: 'bottom'
                            });
                            setTimeout(function(){
                              api.closeWin()
                            },2000)
                        }
                    })
                  }
                }
            }
            var even = function() {}
            var newVue = new Vue(vm);
            even();
        })
    }
</script>
</html>
